package com.ruoyi.web.controller.pwk;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.pwk.domain.BusPwkRhoutfallEntprise;
import com.ruoyi.pwk.service.IBusPwkRhoutfallEntpriseService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 入河排污口责任主体信息数据结构Controller
 * 
 * @author ruoyi
 * @date 2025-10-02
 */
@RestController
@RequestMapping("/pwk/rhoutfallentprise")
public class BusPwkRhoutfallEntpriseController extends BaseController
{
    @Autowired
    private IBusPwkRhoutfallEntpriseService busPwkRhoutfallEntpriseService;

    /**
     * 查询入河排污口责任主体信息数据结构列表
     */
    //@PreAuthorize("@ss.hasPermi('pwk:rhoutfallentprise:list')")
    @GetMapping("/list")
    public TableDataInfo list(BusPwkRhoutfallEntprise busPwkRhoutfallEntprise)
    {
        startPage();
        List<BusPwkRhoutfallEntprise> list = busPwkRhoutfallEntpriseService.selectBusPwkRhoutfallEntpriseList(busPwkRhoutfallEntprise);
        return getDataTable(list);
    }

    @GetMapping("/listall")
    public AjaxResult listall(BusPwkRhoutfallEntprise busPwkRhoutfallEntprise)
    {
        List<BusPwkRhoutfallEntprise> list = busPwkRhoutfallEntpriseService.selectBusPwkRhoutfallEntpriseList(busPwkRhoutfallEntprise);
        return AjaxResult.success(list);
    }

    /**
     * 导出入河排污口责任主体信息数据结构列表
     */
    //@PreAuthorize("@ss.hasPermi('pwk:rhoutfallentprise:export')")
    @Log(title = "入河排污口责任主体信息数据结构", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, BusPwkRhoutfallEntprise busPwkRhoutfallEntprise)
    {
        List<BusPwkRhoutfallEntprise> list = busPwkRhoutfallEntpriseService.selectBusPwkRhoutfallEntpriseList(busPwkRhoutfallEntprise);
        ExcelUtil<BusPwkRhoutfallEntprise> util = new ExcelUtil<BusPwkRhoutfallEntprise>(BusPwkRhoutfallEntprise.class);
        util.exportExcel(response, list, "入河排污口责任主体信息数据结构数据");
    }

    /**
     * 获取入河排污口责任主体信息数据结构详细信息
     */
    //@PreAuthorize("@ss.hasPermi('pwk:rhoutfallentprise:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return success(busPwkRhoutfallEntpriseService.selectBusPwkRhoutfallEntpriseById(id));
    }

    /**
     * 新增入河排污口责任主体信息数据结构
     */
    //@PreAuthorize("@ss.hasPermi('pwk:rhoutfallentprise:add')")
    @Log(title = "入河排污口责任主体信息数据结构", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody BusPwkRhoutfallEntprise busPwkRhoutfallEntprise)
    {
        return toAjax(busPwkRhoutfallEntpriseService.insertBusPwkRhoutfallEntprise(busPwkRhoutfallEntprise));
    }

    /**
     * 修改入河排污口责任主体信息数据结构
     */
    //@PreAuthorize("@ss.hasPermi('pwk:rhoutfallentprise:edit')")
    @Log(title = "入河排污口责任主体信息数据结构", businessType = BusinessType.UPDATE)
    @PostMapping("/edit")
    public AjaxResult edit(@RequestBody BusPwkRhoutfallEntprise busPwkRhoutfallEntprise)
    {
        return toAjax(busPwkRhoutfallEntpriseService.updateBusPwkRhoutfallEntprise(busPwkRhoutfallEntprise));
    }

    /**
     * 删除入河排污口责任主体信息数据结构
     */
    //@PreAuthorize("@ss.hasPermi('pwk:rhoutfallentprise:remove')")
    @Log(title = "入河排污口责任主体信息数据结构", businessType = BusinessType.DELETE)
	@PostMapping("/remove/{ids}")
    public AjaxResult remove(@PathVariable String[] ids)
    {
        return toAjax(busPwkRhoutfallEntpriseService.deleteBusPwkRhoutfallEntpriseByIds(ids));
    }
}
